package com.ck.springboot.rabbitmq.receiver;

import com.ck.springboot.rabbitmq.constants.Constant;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * @Classname DirectReceiver
 * @Description TODO
 * @Date 2021/3/22 14:08
 * @Created by lpc
 */
@Component
@RabbitListener(queues = Constant.DIRECT_QUEUE)//监听的队列名称 directQueue
public class DirectReceiver {

    @RabbitHandler
    public void process(Map testMessage) {
        System.out.println("DirectReceiver消费者收到消息  : " + testMessage.toString());
    }

}